package org.ch00.test05;

import java.util.Arrays;
import java.util.List;
import java.util.Random;

/*
 *
 *@author XCH
 *@date 2025 - 03 - 05 - 09:02
 *
 */
public class MinTest {
    public static void main(String[] args) {

        List<Door> doors = Arrays.asList(
                new MuMen("木门"),     // 木门
                new TieMen("铁门"),    // 铁门
                new SecurityDoor("安全门") // 安全门
        );

        // 随机选择一扇门
        Random random = new Random();
        Door targetDoor = doors.get(random.nextInt(doors.size()));
        System.out.println("随机选择的门是：" + targetDoor.getName());
        System.out.println("-------------------------------------");

        // 执行用户操作
        User user = new User();
        user.comeIn(targetDoor);
        System.out.println("-------------------------------------");

        // 执行偷窃操作
        Thief thief = new Thief();
        thief.steal(targetDoor);

    }
}
